---
import LayoutMain from "@layouts/LayoutMain.astro";
import LayoutMainBottom from "@layouts/LayoutMainBottom.astro";
import LayoutMainBottomLeft from "@layouts/LayoutMainBottomLeft.astro";
import LayoutMainBottomRight from "@layouts/LayoutMainBottomRight.astro";
import LayoutMainTop from "@layouts/LayoutMainTop.astro";
import IndexCarousel from "@components/index/IndexCarousel.astro";
import IndexBanner from "@components/index/IndexBanner.astro";
import IndexLeft from "../index/IndexLeft.astro";
import AsideNotice from "../common/aside/AsideNotice.astro";
import AsideAuther from "../common/aside/AsideAuther.astro";
import AsideComment from "../common/aside/AsideComment.astro";
import AsideWebInfo from "../common/aside/AsideWebInfo.astro";
import AsideHotTag from "../common/aside/AsideHotTag.astro";
import AsideArticleList from "../common/aside/AsideArticleList.astro";
import LayoutFooter from "@layouts/LayoutFooter.astro";
import CommonTool from "@components/common/CommonTool.astro";
import CommonFooter from "@components/common/CommonFooter.astro";

// 事件传递
const event = function (scrollTop: number) {
  const webTool = document.querySelector("#web-tool");
  const m = document.querySelector("#hot-category-box");
  if (m) {
    if (scrollTop > 580) {
      m.classList.add("hot-category-box");
    } else {
      m.classList.remove("hot-category-box");
    }
  }
  if (scrollTop > 200) {
    webTool!.classList.remove("hidden");
  } else {
    webTool!.classList.add("hidden");
  }
};
---

<LayoutMain>
  <LayoutMainTop >
    <IndexCarousel />
    <IndexBanner />
  </LayoutMainTop>
  <LayoutMainBottom>
    <LayoutMainBottomLeft>
      <IndexLeft  />
    </LayoutMainBottomLeft>
    <LayoutMainBottomRight event={event}>
      <AsideAuther />

      <AsideComment />

      <AsideNotice />

      <AsideHotTag />

      <AsideArticleList />

      <AsideWebInfo />
      <CommonTool></CommonTool>
    </LayoutMainBottomRight>
  </LayoutMainBottom>
</LayoutMain>
<LayoutFooter >
   <CommonFooter></CommonFooter>
</LayoutFooter>


